<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>模板管理</title>
<link href="<%=path%>/favicon.ico" rel="shortcut icon">

	<script type="text/javascript" src="<%=path%>/js/marketing/ckeditor/ckeditor.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/ckeditor/sample.js"></script>

<%--<script type="text/javascript" src="<%=path%>/js/marketing/ckeditor/ckeditor.js"></script>--%>
<link href="<%=path%>/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="<%=path%>/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="<%=path%>/hplus/css/animate.min.css" rel="stylesheet">
<link href="<%=path%>/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">


</head>
<body  class="gray-bg">
   <div class="wrapper wrapper-content animated fadeInRight">
	<div class="container-fluid">
		<div class="row white-bg"  style="padding:40px">
			<div class="col-md-7 k_activity" id="photo" style="border: 1px dashed gray;" >
				<div >
					<div id="editor">

					</div>
					<h3 id="h3_bnsp">&nbsp;</h3>
					<div class="col-md-12" >
					    <center>
					    	<span id="span_weixin" hidden="true">
					    		<img id="weixin_qrcode" src="<%=path%>/images/marketing/img_load_error.png"
															style="width: 100px; height: 100px;" />
															<br/><b id="s" hidden="true">微信二维码</b>
					    	</span>

					    	<span id="span_weibo" hidden="true">
					    		<img id="weibo_qrcode" src="<%=path%>/images/marketing/img_load_error.png"
															style="width: 100px; height: 100px;" />
															<br/><b>微博二维码</b>
					    	</span>
					    	</center>
					</div>
				</div>


				<div class="col-sm-12">
				  <ul class="col-md-12 s_footer" style="margin-top:80px">
				  </ul>
				</div>
			</div>
			<canvas id="canvas" width="5" height="5"></canvas>
			<div class="col-md-5 text-left">
			    <div class="col-md-2"></div>
			    <button type="button" class="btn btn-primary" onclick="toUpdate()">重新编辑</button>
                <button type="button" class="btn btn-primary" style="margin-left:5px" onclick="save()">保存</button>
		</div>
	</div>
   </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
   	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/html2canvas.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
    <script type="text/javascript">
    var id="";
	//初始化加载数据
	$(function(){
		id=getQueryString("id");
		var url = "<%=path%>/distinction/ajaxGetPreviewData";
		$.post(url,
				{"id":id},
				function(data) {
					id=data.id;
					var html=data.description;
			    	$('#editor').html(html);
			    	$("#editor").find('img').css("width","100%");
					$("#editor").find('img').css("height","");
					$("#title").append(data.title);
					$("#content").append(data.content);
					if(data.pic!=""){
						$("#pics").attr("hidden",false);
						$("#pic").attr("src",data.pic);
					}
					if(StringEmpty(data.weibo_qrcode)){
						$("#span_weibo").attr("hidden",false);
						$("#weibo_qrcode").attr("src",data.weibo_qrcode);
		
					}else if(StringEmpty(data.weixin_qrcode)){
						$("#s").attr("hidden",false);
						$("#span_weixin").attr("hidden",false);
						$("#weixin_qrcode").attr("src",data.weixin_qrcode);
		
					}else{
						$("#span_weixin").attr("hidden",true);
					}
				});
	});
	//重新编辑
	function toUpdate(){
		location.href="<%=path%>/view/ui/editDistinctio?id="+id;
	}
	//保存
	function save(){
		location.href="<%=path%>/view/ui/toDistinctionList"
	}

    </script>


</body>
</html>